import {post, get} from '@/utils/request'

const pageQuestionnaire = (params) => get(`/questionnaire/page/${params.pageNum}/${params.pageSize}`)
const addQuestion = params => post(`/questionnaire/add`, params)
const createQuestionnaire = params => post(`/questionnaire/create`, params)
const queryQuestionnaireDetail = (params) => get(`/questionnaire/detail/${params}`)
const publishQuestionnaire = (params) => get(`/questionnaire/publish/${params}`)
const deleteQuestionnaire = (params) => get(`/questionnaire/delete/${params}`)
const searchQuestionnaire = (params) => get(`/questionnaire/search/${params.title}/${params.pageNum}/${params.pageSize}`)
const deleteQuestion = (params) => get(`/questionnaire/question/delete/${params}`)
const analyse = (params) => get(`/questionnaire/analyse/${params}`)
const submitInfo = (params) => get(`/questionnaire/submit/${params.questionnaireId}/${params.pageNum}/${params.pageSize}`)

export {
  pageQuestionnaire,
  addQuestion,
  queryQuestionnaireDetail,
  publishQuestionnaire,
  deleteQuestionnaire,
  createQuestionnaire,
  searchQuestionnaire,
  deleteQuestion,
  analyse,
  submitInfo
}
